﻿using SoftwareConsulting.BI11.NumericalMethods.Interfaces;
using SoftwareConsulting.BI11.NumericalMethods.Optimization;

namespace SoftwareConsulting.BI11.NumericalMethods.Optimization
{
    /// <summary>
    /// Класс фабрики точек и векторов, подозрительных на максимум
    /// </summary>
    public class SuspiciousMaximumPointAndVectorFactory : SuspiciousOptimalPointAndVectorFactory
    {
        /// <summary>
        /// Конструктор класса
        /// </summary>
        public SuspiciousMaximumPointAndVectorFactory() : 
            base()
        {
        }

        /// <summary>
        /// Создает точку, подозрительную на максимум
        /// </summary>
        /// <param name="argument"></param>
        /// <param name="function"></param>
        /// <returns></returns>
        public override SuspiciousOptimalPoint CreatePoint(double argument, IOneVariableFunction function)
        {
            return new SuspiciousMaximumPoint(argument, function);
        }

        /// <summary>
        /// Создает вектор, подозрительный на максимум
        /// </summary>
        /// <param name="argument"></param>
        /// <param name="function"></param>
        /// <returns></returns>
        public override SuspiciousOptimalVector CreateVector(double[] argument, IManyVariableFunction function)
        {
            return new SuspiciousMaximumVector(argument, function);
        }
    }
}
